class Test {
    constructor() {
        this.a = 123;
        this.print = () => {
            console.log(this.a);
        }
    }
    // print = () => {  // 字段初始化器的写法,this始终绑定创建的对象
    //     console.log(this.a);
    // }
}


const t1 = new Test();
const t2 = new Test();
console.log(t1);
console.log(t2);
console.log(t1.print === t2.print); // false

t1.a = 1;
t2.a = 2;

t1.print();
t2.print();


